package com.deshan.websys.code.utils;

import java.util.List;

import com.github.houbb.sensitive.word.core.SensitiveWordHelper;

/**
 * 敏感词工具类
 * 
 * @author Administrator
 *
 */
public final class SensitiveWordUtils {

	/**
	 * 判断是否包含敏感词
	 */
	public static boolean isContains(String text) {
		return SensitiveWordHelper.contains(text);
	}

	/**
	 * 返回所有敏感词
	 */
	public static List<String> findAll(String text) {
		return SensitiveWordHelper.findAll(text);
	}

	/**
	 * 默认的替换策略，用*替换
	 */
	public static String defaultReplace(String text) {
		return SensitiveWordHelper.replace(text);
	}

	/**
	 * 指定替换敏感词所用的字符
	 */
	public static String specifiedReplace(String text) {
		return SensitiveWordHelper.replace(text, '0');
	}
}
